<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    var arr=[1,2,3,5,6,8];
    function min(arr){
    var min=arr[0];
    var index=0;
    for(i=0;i<arr.length;i++){
        if(arr[i]<min){
            min=arr[i];
            index=i
        }
    }
    return [`最小值是：${min},下标是：${i}`]
}
console.log(min(arr));

</script>